package com.vogue.supplymall.payment.dto;

import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 调用支付宝支付接口传入的参数
 * 
 * @author 崔岳
 *
 */
public class InputParameter extends ValidationDTO implements Serializable{

	/**
	 * 验证有效值的字段集合
	 */
	@SuppressWarnings("serial")
	public static final Map<String, List<Object>> valueValidityMap = new HashMap<String, List<Object>>() {{
		 put("paytypeid", Arrays.asList((new Integer[]{5, 6, 7, 8})));
		 put("cardflag", Arrays.asList((new Integer[]{0, 1})));
		 put("product", Arrays.asList((new String[]{"600000","700000"})));
		 put("isdis", Arrays.asList((new Integer[]{0, 1})));
	}};
	
	/**
	 * 验证必填字段的集合
	 */
	public static final List<String> requiredList = Arrays.asList((new String[]{
		"paytypeid", "data", "orderid", "storeid", "money", "dismoney", 
		"items","itemid", "itemname", "itemcount", "price"
	}));
	
	/**
	 * 支付方式（5：闪惠 6：微信 7：百度钱包 8：支付宝）(必填)
	 */
	private Integer paytypeid;
	
	/**
	 * 支付总体内容 填充内部类Order对象即可(必填)
	 */
	private InputParameterOrder data;
	
	/**
	 * 支付方式（5：闪惠 6：微信 7：百度钱包 8：支付宝）(必填)
	 */
	public Integer getPaytypeid() {
		return paytypeid;
	}

	/**
	 * 支付方式（5：闪惠 6：微信 7：百度钱包 8：支付宝）(必填)
	 */
	public void setPaytypeid(Integer paytypeid) {
		this.paytypeid = paytypeid;
	}

	/**
	 * 支付总体内容 填充内部类Order对象即可(必填)
	 */
	public InputParameterOrder getData() {
		return data;
	}

	/**
	 * 支付总体内容 填充内部类Order对象即可(必填)
	 */
	public void setData(InputParameterOrder data) {
		this.data = data;
	}

	List<String> requiredFieldList(){
		return requiredList;
	}

	@Override
	Map<String, List<Object>> valueValidityMap() {
		return valueValidityMap;
	}
}
